Developer --> Technical Publications

     


Saving Changes

Navigation Services allows you to display a standard alert box for saving changes or quitting an application, and to customize this alert box for other uses.

Note: You are strongly encouraged to make all Navigation Services dialog boxes movable by providing updates via an event-handling function. For more information, see Handling Events.

Displaying a Standard Save Changes Alert Box

To display a standard Save Changes alert box, your application passes its name and the document title to the function , which displays the alert box shown in Figure 2-11.

Figure 2-11 Standard Save Changes alert box

After the user closes the Save Changes alert box, Navigation Services tells your application which button the user clicked by returning one of the NavAskSaveChangesResult constants, as described in .

Customizing the Save Changes Alert Box

You can display a customized Save Changes alert box by using the function . Figure 2-12 shows an example of a customized Save Changes alert box.

Figure 2-12 Custom Save Changes alert box

You must provide the message to be displayed in a custom Save Changes alert box by specifying a string in the message field of a structure.

Displaying a Discard Changes Alert Box

If your application has a Revert to Saved or similar item in its File menu, Navigation Services provides an alert box to handle this situation, as shown in Figure 2-13. This alert box is created by calling the function .

Figure 2-13 Discard Changes alert box

After the user closes the alert box, Navigation Services tells your application which button the user clicked by returning one of the NavAskDiscardChangesResult constants, as described in .


© 2000 Apple Computer, Inc. (Last Updated 18 April 00)